<template>
  <div>
    <!--金卡协议-->
    <p class="text" v-html="goods.agreement"></p>
    <router-link :to="{path:'/submitorder',query:{goodsId:goods.goodsId}}" tag="p" class="offer" v-if="showType">同意并支付
    </router-link>
  </div>
</template>

<script type="text/ecmascript-6">
  import {getVipcardDetail} from '../../../../test/unit/http'
  import {Toast} from 'we-vue'

  export default {
    name: 'jinkaxieyi',
    props: {},
    data() {
      return {
        goods: {},
        showType: false
      };
    },
    methods: {
      getVipcardDetailData(params) {
        getVipcardDetail(params).then(res => {
          console.log(res);
          if (res.code == 100) {
            this.goods = res.object;
          } else {
            Toast.fail(res.info);
          }
        })
      }
    },
    created() {
      let goodsId = this.$route.query.goodsId;
      let showType = this.$route.query.showType;
      this.showType = showType;
      this.getVipcardDetailData({goodsId: goodsId});
    },
    components: {}
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less" rel="stylesheet/less">
  .title {
    font-size: 20px;
    color: #111;
    font-weight: 700;
    padding: 10px;
  }

  .text {
    font-size: 15px;
    color: #666;
    line-height: 25px;
    text-indent: 30px;
    text-align: left;
    padding: 10px 10px 60px;
  }

  .offer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-image: linear-gradient(to right, #f9964e, #ff8551);
    height: 50px;
    line-height: 50px;
    color: #fff;
  }
</style>
